package com.qf.shop.auth.shop10auth;

import com.wf.captcha.SpecCaptcha;
import com.wf.captcha.base.Captcha;
import com.wf.captcha.utils.CaptchaUtil;

import java.awt.*;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;

public class Demo {

    public static void main(String[] args) throws FileNotFoundException {

        // 三个参数分别为宽、高、位数
        SpecCaptcha specCaptcha = new SpecCaptcha(130, 48, 5);
        // 设置字体
        specCaptcha.setFont(new Font("Verdana", Font.PLAIN, 32));  // 有默认字体，可以不用设置
        // 设置类型，纯数字、纯字母、字母数字混合
        specCaptcha.setCharType(Captcha.TYPE_DEFAULT);

        String s = specCaptcha.text().toLowerCase();
        System.out.println(s);

        specCaptcha.out(new FileOutputStream("./code.png"));
    }
}
